package cn.xiaohuodui.rest;

import cn.xiaohuodui.util.alioss.AliOssUploader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

/**
 * Author :keepcleargas
 * Date   :2016-12-16 11:49.
 */
@Controller
@RequestMapping("/v1/bases")
public class BaseApi {
    @Autowired
    AliOssUploader aliOssUploader;

    /**
     * 获取alioss图片上传的token
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/uploadToken", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public Map getImageUploadToken() {
        return aliOssUploader.generateSts(0);
    }
}
